package com.huluobo.lc.a1803aretrofitrxdemo.mvp;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.huluobo.lc.a1803aretrofitrxdemo.R;
import com.huluobo.lc.a1803aretrofitrxdemo.network.schedulers.SchedulerProvider;

/**
 * @author Lc
 * @description:
 * @date :2020/11/10 15:50
 */
class ViewActivity extends AppCompatActivity implements Contract.View {
    private Presenter presenter;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        presenter = new Presenter(new Model(),this, SchedulerProvider.getInstance());
        Button text=findViewById(R.id.textBtn);
        text.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                presenter.getCarList("userId");
            }
        });
    }

    @Override
    public void getDataSuccess() {
        //请求成功之后View的反馈
    }

    @Override
    public void getDataFailed() {
        //请求失败之后View的反馈
    }
}
